package com.aps.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author liaoguangan
 * @description <监控排程>
 * @date 2018/4/1 17:45
 */

@Component
public class ScheduleThread implements Runnable {

    @Autowired
    private IApsOrderService orderService;

    @Override
    public void run() {
        while (true) {
            if (orderService.readSchedule()) {
                orderService.schedule();
            }
        }
    }

    public void start() {
        new Thread(this).start();
    }
}
